//
//  NSString+Extension.h
//  ChatForHot
//
//  Created by wr on 2018/10/9.
//  Copyright © 2018年 FLY. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NSString (Extension)

+ (BOOL)isEmpty:(NSString *)string;
- (BOOL)isNotBlank;
- (NSString*)substringFrom:(NSInteger)from to:(NSInteger)to;
- (NSInteger)indexOf:(NSString*)string from:(NSInteger)from;
- (BOOL)startsWith:(NSString*)string;
- (BOOL)containsString:(NSString*)string;
- (NSString *)HOTCHATTotalStringUrl;
- (NSString *)HOTCHATmaxLength:(NSInteger)maxLen;
- (NSInteger)HOTCHATleftCharWithmaxLength:(NSInteger)maxLen;

- (NSString *)HOTCHATgetVipStr;

@end

@interface NSString (Transform)

- (NSString *)md5;
- (NSString *)base64;
+ (NSString *)uniqueString;
- (NSString *)urlEncodedString;
- (NSString *)urlDecodedString;
+ (NSString *)convertDataToHexStr:(NSData *)data;
- (NSString *)removeMagicalChar;
- (NSUInteger)lengthWhenCountingNonASCIICharacterAsTwo;
- (NSString *)substringAvoidBreakingUpCharacterSequencesToIndex:(NSUInteger)index
                                                      lessValue:(BOOL)lessValue
                                 countingNonASCIICharacterAsTwo:(BOOL)countingNonASCIICharacterAsTwo;
@end

@interface NSString (Trim)

- (NSString *)trim;
- (NSString *)stringByTrim;
- (NSString *)trimSpaceAndEnter;
- (void)trimSpaceAndEnterAtTheEnd:(NSMutableString *)text;
@end

@interface NSString (Layout)

- (CGSize)sizeForFont:(UIFont *)font size:(CGSize)size mode:(NSLineBreakMode)lineBreakMode;
- (CGFloat)widthForFont:(UIFont *)font;
- (CGFloat)heightForFont:(UIFont *)font width:(CGFloat)width;
@end
